package com.xxrl.shop.service;

import com.xxrl.shop.domain.SysPermission;
import com.xxrl.shop.repository.SysPermissionRepository;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author mis
 */
@Service
public class SysPermissionService {

    private final SysPermissionRepository sysPermissionRepository;

    public SysPermissionService(SysPermissionRepository sysPermissionRepository) {
        this.sysPermissionRepository = sysPermissionRepository;
    }

    public List<SysPermission> getPermissionByPath(String path) {
        return sysPermissionRepository.getSysPermissionsByPath(path);
    }

    public void savePermission(SysPermission permission) {
        sysPermissionRepository.save(permission);
    }
}
